---
title: ImageMovePopup context validation and security check
summary: Validates claim/policy context, enforces AD-group-based claim/image security checks, and captures an optional notify task for an image move.
status: draft
owner: <owner>
last_reviewed: 2026-08-21
library: SAIF.Presentation.Web.Controls.PopUps.Infragistics111
reference_type: package
operation_id: OP-3
trigger: Hosting page sets Active = True and ImageFileCode ("CLAIM" or otherwise treated as policy context).
---

# ImageMovePopup context validation and security check

This operation resolves a Claim or Policy context number to display the worker's name (or "Confidential" if access is denied), enforces AD-group-based claim and image security, and optionally captures a notify task alongside confirming an image-move request.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-3 |
| **Trigger** | Hosting page sets `Active = True` and `ImageFileCode` (`"CLAIM"` or otherwise treated as policy context). |
| **Inputs** | `ImageFileCode`, `txtContextNum`, `txtNotifyID`, `wdteNotifyDate`, `txtNotifyText` |
| **Outputs** | `ConfirmAction(Confirm, ImageMoveEventArgs)`; public `CheckImageSecurity`/`CheckClaimSecurity` boolean/out-parameter authorization results |
| **Primary components** | `ImageMovePopup.EditContext`, `ImageMovePopup.CheckClaimSecurity`, `ImageMovePopup.CheckImageSecurity`, `ImageMovePopup.SetSecurityUserImage`, `ImageMovePopup.EditAlertControls`, `ImageMovePopup.SaveButtonClick` |
| **Entry point** | `SAIF.Presentation.Web.Controls.PopUps.Infragistics111\ImageMovePopup.vb` |

## Steps

1. On `txtContextNum` `TextChanged` (auto-postback), `RetrieveName()` calls `EditContext()`.
2. `EditContext()`:
   - If `ImageFileCode = "CLAIM"`, calls `GetClaimData()` → `clsClaimData.GetData(DataPortalInfo, contextNum)` (referenced package call, not traced further)**.
   - If the claim is found, calls `CheckClaimSecurity(MyClaimData.Security, String.Empty, AccessAllowed, LastError)` ([BR-IMG-001](../business-rules.md#br-img-001-claim-context-lookup-blocks-the-worker's-name-for-confidential-claims-the-caller-cannot-view)):
     - Domain gate: if `mySecurity.Domain <> "SAIF"`, denies unconditionally ([BR-IMG-004](../business-rules.md#br-img-004-claim-security-checks-are-enforced-only-for-the-saif-domain%3B-non-saif-callers-are-denied-outright)).
     - Else evaluates up to 4 claim-security flags (`IsConflict`, `IsExposure`, `IsHealthIssue`, `IsHostileWorker`) against the corresponding AD resources ([BR-IMG-002](../business-rules.md#br-img-002-conflict-claim-visibility-requires-the-conflictclaim-(adsg_claim_conflict)-ad-resource), [BR-IMG-003](../business-rules.md#br-img-003-exposure-claim%2C-collateral-health%2C-and-hostile-worker-claim-visibility-each-require-a-distinct-ad-resource)).
     - On failure of any check, masks the worker's name as `"Confidential"` and sets `ErrorMsg`.
   - Otherwise (non-`"CLAIM"` context), calls `GetPolicyData()` → `clsPolicyData.GetPolicyData(DataPortalInfo, policyNum)` and shows `MyPolicyData.PolicyName` if found, else `MSG_WAR_NO_POLICY`; no analogous security check exists for the policy path*.
3. `EditAlertControls()` validates the optional notify task ([BR-POPUP-003](../business-rules.md#br-popup-003-notify-entry-requires-a-notify-id%2C-a-valid-notify-date%2C-and-the-date-must-not-precede-today)):
   - If `txtNotifyText` has content, `txtNotifyID` must also be non-empty (else `MSG_ENTER_VALID_NOTIFY_ID`).
   - A non-empty `wdteNotifyDate` cannot be earlier than today (else `MSG_NOTIFY_DATE_PRIOR_TO_TODAY`).
4. `Render()` calls `SetSecurityUserImage()` to populate the `ImageSecurity` cached-flags structure from `clsSecurityPrincipal.IsAuthorized(...)` for each `ADSG_*` resource name; the resulting `myImageSecurity` fields are not observed to gate any rendering decision beyond population**. The popup is then positioned and rendered.
5. On `cmdSave` click, `SaveButtonClick()` re-runs `EditContext()` then `EditAlertControls()`; only if both succeed does it raise `ConfirmAction(True, New ImageMoveEventArgs(contextNum, notifyID, notifyDate, notifyText))`.
6. On `cmdCancel` click, raises `ConfirmAction(False, ...)` with current field values and calls `ResetControls()`.
7. Public method `CheckImageSecurity(inImageFileCode, inMailId)`:
   - Returns `True` unconditionally for a fixed allow-list of system mailboxes ([BR-IMG-005](../business-rules.md#br-img-005-certain-system-mailboxes-are-always-allowed-to-receive-image-alerts)).
   - If `inMailId` equals the current user, returns the cached `myImageSecurity.HasImage` flag ([BR-IMG-006](../business-rules.md#br-img-006-image-access-for-the-current-user-vs.-a-delegated-mail-id-uses-different-authorization-sources)).
   - Otherwise, delegates to `ImageServices.HasADAccessToImageResource(inImageFileCode, inMailId)` (external/referenced call, not traced further)**.

## Process flow

The following diagram visualizes the context validation and security check flow.

```mermaid
flowchart TD
	Start([txtContextNum TextChanged]) --> Edit[EditContext]
	Edit --> Type{ImageFileCode = CLAIM?}
	Type -->|Yes| Claim[GetClaimData]
	Claim --> Sec[CheckClaimSecurity]
	Sec --> Domain{Domain = SAIF?}
	Domain -->|No| Deny([Deny outright])
	Domain -->|Yes| Flags{Any claim flag fails resource check?}
	Flags -->|Yes| Mask([Show Confidential, set ErrorMsg])
	Flags -->|No| ShowName([Show worker name])
	Type -->|No| Policy[GetPolicyData, show PolicyName]
	ShowName --> Alert[EditAlertControls validates notify fields]
	Mask --> Alert
	Policy --> Alert
	Alert --> Save{cmdSave clicked}
	Save -->|Valid| Confirm([ConfirmAction True with ImageMoveEventArgs])
	Save -->|Invalid| Blocked([Popup stays active, ErrorMsg shown])
```

## Failure and edge-case behavior

- Non-`"SAIF"`-domain callers are denied claim access unconditionally, independent of the 4 flag-level checks ([BR-IMG-004](../business-rules.md#br-img-004-claim-security-checks-are-enforced-only-for-the-saif-domain%3B-non-saif-callers-are-denied-outright)).
- When claim access is denied, `EditContext()` sets the UI-bound `ErrorMsg` to the generic `MSG_WAR_NO_CLAIM` rather than the more specific `MSG_NOT_AUTH_CLAIM`/`LastError` value returned by `CheckClaimSecurity` — whether this is intentional is unconfirmed*.
- The policy-context branch performs no equivalent ownership/security check before displaying `MyPolicyData.PolicyName`*.

## Related documentation
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [Security and authorization](../security-authorization.md)

## Sources
- `SAIF.Presentation.Web.Controls.PopUps.Infragistics111\ImageMovePopup.vb`
- `SAIF.Presentation.Web.Controls.PopUps.Infragistics111\ImageMovePopup.ascx`
